package com.bschlearn.group.message;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import lombok.Data;

/**
 * 
 * @ClassName: BaseReq 
 * @Description: TODO(请求的基类) 
 * @author dcc
 * @date 2019年10月31日 上午11:54:50 
 *
 */
@Data
public class BaseReq{
	
	/**
	 * request
	 */
	private HttpServletRequest request;
	
	public BaseReq(){
		if(null == request) {
			RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
			RequestContextHolder.getRequestAttributes();
			request = ((ServletRequestAttributes)requestAttributes).getRequest();
		}
		
	}

}
